package Ex7_2;

public class Coisa {
	
	
	/**
	 * 
	 */
	public Coisa() {
		super();
	}
	
	public int partida(String obj1, String obj2){
		if(obj1.equalsIgnoreCase(obj2)){
			System.out.println("Empate!");
			return 0;
		}else{
			if(obj1.equalsIgnoreCase("Papel")){
				if(obj2.equalsIgnoreCase("Pedra")){
					System.out.println("Papel envolve Pedra");
					return 1;
				}
				if(obj2.equalsIgnoreCase("Tesoura")){
					System.out.println("Tesoura corta Papel");
					return 2;
				}
			}
			if(obj1.equalsIgnoreCase("Pedra")){
				if(obj2.equalsIgnoreCase("Papel")){
					System.out.println("Papel envolve Pedra");
					return 2;
				}
				if(obj2.equalsIgnoreCase("Tesoura")){
					System.out.println("Pedra quebra Tesoura");
					return 1;
				}
			}
			if(obj1.equalsIgnoreCase("Tesoura")){
				if(obj2.equalsIgnoreCase("Papel")){
					System.out.println("Tesoura corta Papel");
					return 1;
				}
				if(obj2.equalsIgnoreCase("Pedra")){
					System.out.println("Pedra quebra Tesoura");
					return 2;
				}
			}
		}
//		System.out.println(jogo.getPlayer1() + "     x    " + jogo.getPlayer2());	
		return 0;
	}
}
